package com.iot.gateway.tsl.qo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 设备事件请求 QO
 * 用于接收前端新增/更新设备事件的参数，包含固定字段和动态扩展字段
 *
 * @author guoxinyu
 * @create 2025/5/27 18:15
 */
@Data
@Schema(name = "EventQo", description = "设备事件请求 QO，包含固定字段和动态扩展字段")
public class EventQo {

    @Schema(description = "事件唯一标识符，更新时必填，新增可不填", example = "f47ac10b-58cc-4372-a567-0e02b2c3d479")
    private String id;

    @Schema(description = "事件名称", required = true, example = "overheatAlarm")
    private String name;

    @Schema(description = "事件描述", example = "设备温度超限报警")
    private String description;

    @Schema(description = "事件类型: info、alert、error", example = "alert")
    private String type;

    @Schema(description = "是否必选", example = "false")
    private Boolean required;

    @Schema(description = "事件输出参数列表")
    private List<EventOutputParamQo> outputData;

    @Schema(description = "自定义扩展字段，任意键值对，Map 格式", example = "{\"threshold\":75,\"level\":\"high\"}")
    private Map<String, Object> customFields;
}
